<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="../css/reset.css">
    <style>
        .container {
            max-width: 1200px;
            margin: auto;
            line-height: 50px;
        }

        header .container {
            display: flex;
            justify-content: space-between;
        }

        header ul {
            display: flex;
        }

        header ul li {
            margin-right: 30px;
        }

        @media screen and (max-width:768px) {
            header label {
                width: 30px;
                height: 30px;
                background-color: #ff0;
            }

            header ul {
                position: fixed;
                width: 100%;
                background-color: #000;
                color: aliceblue;
                top: 50px;
                flex-direction: column;
                text-align: center;
                display: none;
            }

            header input:checked ~ ul {
                display: block;
            }
        }
    </style>
</head>

<body>

    <header>
        <div class="container">
            <h1>
                <a href="">logo</a>
            </h1>
            <input type="checkbox" id="c" hidden>
            <label for="c"></label>
            <ul>
                <li>
                    <a href="">首页</a>
                </li>
                <li>
                    <a href="">首页</a>
                </li>
                <li>
                    <a href="">首页</a>
                </li>
                <li>
                    <a href="">首页</a>
                </li>
                <li>
                    <a href="">首页</a>
                </li>
                <li>
                    <a href="">首页</a>
                </li>
                <li>
                    <a href="">首页</a>
                </li>
            </ul>
        </div>
    </header>

</body>

</html>